Interface and Application
This week was about making an app to drive our output or input board. There a lot ways in which this can be done, but I tried the easiest one to learn "MIT App Inventor".
This week was about making an app to drive our output or input board. There a lot ways in which this can be done, but I tried the easiest one to learn "MIT App Inventor".
To use MIT app Inventor one needs to sign in using the "google account", once we are inside we will be asked to take a survey, we can skip it if we want and move to creating a new project.
After this the screen will look something like this, the layout of MIT APP Inventor is very simple, all the components are readily available and clearly visible. The program uses Tree Structure which is just like the one used in designing softwares such as SolidWorks.
This means that the components and the properities have a parent and a daughter relation, this can be seen in the right hand side
Here are a few things one can find at the first glance
I started by selecting the listpicker option in the component section, it will give me a list of avaoilable devices in the vicinity, I am using bluetooth client because my app will use the blue connection to talk to my board.
Thus I pick bluetooth client from the component section and also clock to give me the show me connection in real time, all these components they fall under invisible components-meaning that they will not be shown on the active screen but they willbe constantly working in the background
Now I select label, this will tell me the status of my device wether it is connected or not conected to the selected bluetooth device
And Finally I will be requiring two buttons to turn the LED on/off, I select them from the components list on the left, as I progress the tree structure is getting completed on the right.
We can be creative the design, we can add background colours or images change the font size etc, But I would rather stick to a simple layout without any graphics because it is a simple on/off program, besides the graphics makes your app heavy and takes time to load in your mobile
There is an amazing feature in MIT App Inventor which lets you see the app as you built it, you can find this in the top in the AI companion section under Connect panel, this requires us to have MIT AI Companion app (available on play store) installed in our android device. Its just the question of scanning the QR code and you are live.
This is the designing part of the app, now we want to set alogic for the app to work, we do this in the blocks section(on the top left corner)
It is like programming, we have to specify each component its function using logic.
I installed the app in my android device and checked the connectivity, it was showing me all availble bluetooth devices nearby, this was a big relief, next step was the label should flash connected when I connect it to the desires bluetooth device and it did.
This app is used to turn on the an LED on my hello board, I made this board in my networing and communication assignment last week, the app seems to be working but there is a small glitch, I am able to turn on the LED but it does not turn OFF on pressing the off button, I need to do some trouble shooting here.
Download the .apk file from here
Download the code for the hello board from here
Download the code for the bluetooth board from here
I am running out of time and I want to try one more language , I wanted to try python for a long but learning python in such short time is pretty difficult, thus I decided to try what has already been done.
I tried Neil;s hello echo code, this code is available in the Embedded programming weeks schedule page , I used avr dude to burn the code on to the hello board I designed in the previous week.
The code is basically an echo, it just types back what we have typed in a python serial monitor. This is where python comes into play.
I downloaded term.py file on the same page as above and open the folder containing it in terminal and connect my board to the pc via an FTDI cable.
Before this I had already downloaded Anaconda, this is an open source python. After installing this I typed the following command in terminal python term.py /dev/ttyUSB0/115200 here dev/ttyUSB is the port I conncted my FTDI cable to on my computer and 115200 is the baudrate.
I had a few installation errors such as Installing Tkinter, I have python 2.7 installed on my computer so I after installinf tkinter I had to change the name in the trm.py file to tkinter(notice the small t) if it had been pyhton 3.0 it would have been Tkinter ( with a capital t)
After everything is done I am getting an echo on the monitor.
I want to try a few more app developing environment but unfortunately I cannot because of the time constrains
I would really like to visit this assignment in the future and try other environments and make cool apps
For me MIT App Inventor has made a dauning task of making my own app look really easy